package cn.webrx;

import java.io.*;

public class File4 {
    public static void main(String[] args) {
        //读取文本文件 1 字节流
        String f = "C:\\javase2203\\ch09\\src\\cn\\webrx\\File1.java";
        try(var fis = new FileInputStream(f)) {
            //System.out.println(new String(fis.readAllBytes()).lines().count());
            //System.out.println(new String(fis.readAllBytes()));
        } catch (IOException e) {
        }

        //字符流读取文件 2
        try(var reader = new BufferedReader(new FileReader("user.txt"))) {
                while(reader.ready()){
                    System.out.println(reader.readLine());
                }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
